//
//  LWPictureQualityViewController.m
//  1.28  weibo
//
//  Created by mac on 15/3/1.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "LWPictureQualityViewController.h"
#import "LWProductChectGroup.h"
#import "LWProductchectItme.h"
@interface LWPictureQualityViewController ()
@property (nonatomic,weak) LWProductchectItme *high;
@property (nonatomic,weak) LWProductchectItme *normal;
@end

@implementation LWPictureQualityViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self setupGroup0];
    [self setupGroup1];
    
    self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 20, 0);
    UIButton *btn = [[UIButton alloc] init];
    btn.size = CGSizeMake(200, 44);
    [btn setBackgroundColor:[UIColor redColor]];
    [btn setTitle:@"退出登录" forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    self.tableView.tableFooterView = btn;
}
- (void)btnClick{

    
}
- (void)setupGroup0{

    LWProductchectItme *high = [LWProductchectItme initWithTitile:@"高清"];
    high.subTitle = @"(建议在wifi或3G网络使用)";
    self.high = high;
    
    LWProductchectItme *normal = [LWProductchectItme initWithTitile:@"普通"];
    normal.subTitle = @"(上传速度快，省流量)";
    
    LWProductChectGroup *group = [[LWProductChectGroup alloc] init];
    group.itmes = @[high,normal];
    
    group.hearderTitle = @"上传图片质量";
    [self.datas addObject:group];
}

- (void)setupGroup1
{
    LWProductchectItme *normal = [LWProductchectItme initWithTitile:@"普通"];
    //    normal.check = YES;
    normal.subTitle = @"(上传速度快，省流量)";
    
    
    LWProductchectItme *high = [LWProductchectItme initWithTitile:@"高清"];
    high.subTitle = @"(建议在wifi或3G网络使用)";
    
    LWProductChectGroup *group = [[LWProductChectGroup alloc] init];
    
    group.itmes = @[high, normal];
    group.hearderTitle = @"下载图片质量";
    
    [self.datas addObject:group];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    LWProductChectGroup *group = self.datas[indexPath.section];
    group.selectIndex = indexPath.row;
    [self.tableView reloadData];
}
@end
